package com.jwcao.common.cast.operation.callback;

import com.jwcao.common.scan.object.ScanClass;

/**
 * name: ToCallBackOperation description: TODO
 *
 * @author caojingwei date: 2023/3/23 19:22
 */
public class ToCallBackOperation {

    private final ScanClass sourceClass;
    private final String methodName;

    public ToCallBackOperation(ScanClass sourceClass, String methodName) {
        this.sourceClass = sourceClass;
        this.methodName = methodName;
    }

    public void execute(Object sourceObject, Object targetObject) {
        sourceClass.invokeVoidMethod(sourceObject, methodName, targetObject);
    }
}
